package com.qf.spring22022.controller;

import com.qf.spring22022.entity.User;
import com.qf.spring22022.utils.QfFileAppender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/hello")
public class HelloController {
    @GetMapping("/test01")
    public String test01() {
        return "hello";
    }

    @GetMapping("/test02/{userid}")
    public User test02(@PathVariable("userid") Integer userid) {
        System.out.println(userid);
        User user = new User();
        user.setId(999);
        user.setName("张三");
        user.setBirthDay(new Date());
        user.setRegistTime(new Date());
        return user;
    }
}
